package model;
// default package

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Tsalereturn entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tsalereturn", catalog = "test")
public class Tsalereturn implements java.io.Serializable {

	// Fields

	private String id;
	private Treceipt treceipt;
	private String salereturnno;
	private String reason;
	private Timestamp createdatetime;
	private String remark;
	private Set<Tsalereturnitem> tsalereturnitems = new HashSet<Tsalereturnitem>(0);

	// Constructors

	/** default constructor */
	public Tsalereturn() {
	}

	/** minimal constructor */
	public Tsalereturn(String id) {
		this.id = id;
	}

	/** full constructor */
	public Tsalereturn(String id, Treceipt treceipt, String salereturnno, String reason, Timestamp createdatetime, String remark, Set<Tsalereturnitem> tsalereturnitems) {
		this.id = id;
		this.treceipt = treceipt;
		this.salereturnno = salereturnno;
		this.reason = reason;
		this.createdatetime = createdatetime;
		this.remark = remark;
		this.tsalereturnitems = tsalereturnitems;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "saleorderid")
	public Treceipt getTreceipt() {
		return this.treceipt;
	}

	public void setTreceipt(Treceipt treceipt) {
		this.treceipt = treceipt;
	}

	@Column(name = "salereturnno")
	public String getSalereturnno() {
		return this.salereturnno;
	}

	public void setSalereturnno(String salereturnno) {
		this.salereturnno = salereturnno;
	}

	@Column(name = "reason")
	public String getReason() {
		return this.reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	@Column(name = "createdatetime", length = 19)
	public Timestamp getCreatedatetime() {
		return this.createdatetime;
	}

	public void setCreatedatetime(Timestamp createdatetime) {
		this.createdatetime = createdatetime;
	}

	@Column(name = "remark")
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tsalereturn")
	public Set<Tsalereturnitem> getTsalereturnitems() {
		return this.tsalereturnitems;
	}

	public void setTsalereturnitems(Set<Tsalereturnitem> tsalereturnitems) {
		this.tsalereturnitems = tsalereturnitems;
	}

}